<%@ page import="java.util.List" %>
<%@ page import="com.atguigu.bean.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

    <%
        List<User> list = new ArrayList<User>();
        list.add(new User(1,"张三1","123"));
        list.add(new User(20,"张三2","123"));
        list.add(new User(33,"张三3","123"));
        list.add(new User(47,"张三4","123"));
        list.add(new User(59,"张三5","123"));
        request.setAttribute("list",list);
    %>

    <c:forEach items="${requestScope.list}" var="user" varStatus="status">
        ${pageScope.status.index+1}-->id:${pageScope.user.id},username:${pageScope.user.username},password:${pageScope.user.password}<br>
    </c:forEach>

    <table>
        <tr>
            <th colspan="3">User Info</th>
        </tr>
        <tr>
            <th>ID</th>
            <th>USERNAME</th>
            <th>PASSWORD</th>
        </tr>
        <c:forEach items="${requestScope.list}" var="user" varStatus="status">
            <tr>
                <td>${pageScope.status.count}</td>
                <td>${pageScope.user.username}</td>
                <td>${pageScope.user.password}</td>
            </tr>
        </c:forEach>
    </table>

</body>
</html>
